<?php
/* 
 *销售退货管理
 */
class Sale_backAction extends TransAction {
    public function _filter(&$map) {
        //TODO
        $key = trim($_REQUEST['keywords']);
        if(!empty($key)) {
            $map['note'] = array('like',"%".$key."%");//备注信息
            $map['title'] = array('like',"%".$key."%");//锚文本
            $map['webname'] = array('like',"%".$key."%");//网站名称
            $map['url'] = array('like',"%".$key."%");//url
            $map['_logic'] = "or";
        }
    }

    public function _before_add(){
        parent::_before_add();
    }

    public function _before_insert(){
        $sale_id = $_POST['sale_id'];
        if (count($sale_id)>1){
            if($sale_id['0'] != $sale_id['1'])
                $this->error('对不起，退货单只能处理一个销售单！');
            foreach ($sale_id as $key=>$val){

            }
        }
    }
}
?>
